package com.game 
{
	import com.config.GameConfig;
	import com.core.loaders.RpcLoader;
	import com.core.utils.RpcData;
	import com.game.baseobj.rpc.RpcAction;
	import com.game.baseobj.rpc.RpcClip;
	import com.game.baseobj.rpc.RpcClipsPerformer;
	
	import flash.events.Event;
	import flash.utils.Dictionary;

	public class PerformerCreator
	{
		public function PerformerCreator()
		{
		}
		
		public static function createAction(role:String,action:String):RpcAction
		{
			var actionconfig:Dictionary = GameConfig.instance.actionConfig[role+":"+action];
			var rpcaction:RpcAction = new RpcAction(action,null,null,null);
			for(var layer:String in actionconfig){
				var lc:Array = actionconfig[layer];
				rpcaction.addLayer(lc);
			}
			return rpcaction;
		}
		
		public static function create(actions:Vector.<RpcAction>=null):RpcClipsPerformer
		{
			var performer:RpcClipsPerformer = new RpcClipsPerformer();
			for each(var action:RpcAction in actions){
				performer.addAction(action);
			}
			return performer;
		}
	}
}